package cn.spike.org.domain;

import cn.spike.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 实体类：部门
 * @author:sea
 * @create:2023-01-09 11:26
 */

@Data
public class Department extends BaseDomain {
    //部门编号
    private String sn;
    //部门名称
    private String name;
    //部门路径
    private String dirPath;
    //部门状态 1-启用默认 0-禁用
    private Integer state = 1;
    //部门经理id
    private Long manager_id;
    //上级部门id
    private Long parent_id;

    //保存上级部门的信息
    private Department department;

    //保存部门经理信息
    private Employee employee;

    //保存部门树的数据信息 - 需要给一个默认值 - 不然会出现null point exception
    //注解：无限极树最后一级不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
}
